﻿
@{
    Layout = "~/Views/Shared/_AddEdit.cshtml";
}

@section header{
    <script type="text/javascript">
        function SaveBeforeCallBack() {
            var Ssum = 0;
            var Esum = 0;
            if ($("#_CourseName").val() == '') {
                layer.msg('温馨提示：必须填写课程名称~！~'); return true;
            }
        }
    </script>
}

<input type="hidden" name="_CeateId" id="_CeateId" value="@ViewBag.data["CeateId"]" />
<input type="hidden" name="_State" id="_State" value="@ViewBag.data["State"]" />
<input type="hidden" name="_CeateDate" id="_CeateDate" value="@ViewBag.data["CeateDate"]" />
<input type="hidden" name="_LeagueId" id="_LeagueId" value="@ViewBag.data["LeagueId"]" />
<div style=" margin-top:20px;"></div>
<div class="layui-col-md3" style="width:5rem">
</div>
<div class="layui-col-md3">
    <div class="layui-card">
        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color:red">*</span><span style="margin-left:0.5rem">课程系列</span></label>
            <div class="layui-input-block">
                <input type="text" id="_Name" name="_Name" placeholder="请输入系列名称" class="layui-input" style="width:10rem" value="@ViewBag.data["Name"]">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color:red">*</span><span style="margin-left:0.5rem">状态&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></label>
            <div class="layui-input-inline">
                <input type="checkbox" id="" name="" lay-skin="switch" lay-filter="State" title="开关" value="1" @(ViewBag.data["State"] == 1 ? "checked='checked'" : "")>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注信息</label>
            <div class="layui-input-block">
                <textarea name="_Remark" id="_Remark" placeholder="请输入内容" class="layui-textarea" style="min-height:100px;min-width:300px;width:20rem">@ViewBag.data["Remark"]</textarea>
            </div>
        </div>
    </div>
</div>
<div class="layui-col-md3">
</div>

<script>
    layui.use(['form', 'laydate'], function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#BirdDate' //指定元素
            , value: new Date()
        });
    });
    layui.use('form', function () {
        var form = layui.form;
        //各种基于事件的操作，下面会有进一步介绍
        //监听指定开关
        form.on('switch(IsOrder)', function (data) {
            //layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
            //    offset: '6px'
            //});
            if (this.checked) {
                $("#_IsOrder").val("1");
            }
            else {
                $("#_IsOrder").val("0");
            }
        });
        //监听指定开关
        form.on('switch(IsTentative)', function (data) {
            if (this.checked) {
                $("#_IsTentative").val("0");
            }
            else {
                $("#_IsTentative").val("1");
            }
        });

        //监听指定开关
        form.on('switch(State)', function (data) {
            if (this.checked) {
                $("#_State").val("1");
            }
            else {
                $("#_State").val("0");
            }
        });
    })
</script>
